package gtkwire.gobject;

import gtkwire.GTKWireCommand;

public class GtkAdjustment extends GObject
{
	private double value;

	private double lower;
	private double upper;

	private double pageIncrement;
	private double pageSize;
	private double stepIncrement;

	public GtkAdjustment( double value, double lower, double upper, double pagIncrement, double pageSize, double stepIncrement )
	{
		super( GO_GtkAdjustment );

		this.value = value;
		this.lower = lower;
		this.upper = upper;
		this.pageIncrement = pageIncrement;
		this.pageSize = pageSize;
		this.stepIncrement = stepIncrement;

		System.out.println("sadadads");
		 app().createGObject( GO_GtkAdjustment, getId(), getObjData());
	}
/*
	public void setValue( double v )
	{
		value = v;
		setAllValues();
	}

	public double getValue()
	{
		return value;
	}
*/
	public void setLower( double l ) 
	{
		lower = l;
		setAllValues();
	}

	public double getLower()
	{
		return lower;
	}

	public void setUpper( double u )
	{
		upper = u;
		setAllValues();
	}

	public double getUpper()
	{
		return upper;
	}

	public void setPageIncrement( double pinc )
	{
		pageIncrement = pinc;
		setAllValues();
	}

	public double getPageIncrement()
	{
		return pageIncrement;
	}

	public void setPageSize( double ps )
	{
		pageSize = ps;
		setAllValues();
	}

	public double getPageSize()
	{
		return pageSize;
	}
	
	public void setStepIncrement( double si )
	{
		stepIncrement = si;
		setAllValues();
	}

	public double getStepIncrement()
	{
		return stepIncrement;
	}

	private void setAllValues()
	{
		app().sendCommand( MAGIC_NAME, GTKWireCommand.SET_ADJUSTMENT_VALUES, getObjData() );
	}

	private double[] getObjData()
	{
		double[] data = { (double)getId(), value, lower, upper,  stepIncrement, pageIncrement, stepIncrement, pageSize };
		return data;
	}

}//end class

